@(currentPage: com.avaje.ebean.Page[QcmNiveauquestion], currentSortBy: String, currentOrder: String, currentFilter: String)
@header()

@link(newPage:Int, newSortBy:String) = @{
    
    var sortBy = currentSortBy
    var order = currentOrder
    
    if(newSortBy != null) {
        sortBy = newSortBy
        if(currentSortBy == newSortBy) {
            if(currentOrder == "asc") {
                order = "desc"
            } else {
                order = "asc"
            }
        } else {
            order = "asc"
        }
    }
    
    // Generate the link
    routes.AdminQcmNiveauQuestion.listQcmNiveauQuestion(newPage, sortBy, order, currentFilter)
    
}

@headerview(key:String, title:String) = {
    <th class="@key.replace(".","_") headerview @if(currentSortBy == key) @{if(currentOrder == "asc") "headerviewSortDown" else "headerviewSortUp"}">
        <a href="@link(0, key)">@title</a>
    </th>
}

@main("") {

	<div class="bs-docs-example" >
    	
    	<div class="bs-docs-example-after" >
    	Administration
    	</div>
     
     	<legend> Contenu de la table QcmNiveauQuestion </legend>
    	<br>



    @if(flash.containsKey("success")) {
        <div class="alert-message warning">
            <strong>Done!</strong> @flash.get("success")
        </div>
    } 


    @if(currentPage.getTotalRowCount == 0) {
        
        <div class="well">
            <em>Nothing to display</em>
        </div>
        
    } else {
        
       
        <table class="table table-striped">
  <thead>
                <tr>
                	@headerview("idQcmNiveauQuestion", "id du QcmNiveauQuestion")
                   	@headerview("qcm_id_qcm", "Libelle du Qcm")
                   	@headerview("niveau_question_id_niveau_q", "Niveau de la question")
                   	@headerview("pointPositif", "point positif")
                   	@headerview("pointNegatif", "point negatif")
                    
                </tr>
            </thead>
            <tbody>

                @for(qcmNiveauQuestion <- currentPage.getList) {
                    <tr>
                    	<td>
                        	<a href="@routes.AdminQcmNiveauQuestion.editQcmNiveauQuestion(qcmNiveauQuestion.getIdQcmNiveauQuestion)">@qcmNiveauQuestion.getIdQcmNiveauQuestion </a>
                        </td>
                        <td>
                            @if(qcmNiveauQuestion.getQcm == null) {
                                <em>-</em>
                            } else {
                                @qcmNiveauQuestion.getQcm.getLibelle() 
                            }
                        </td>
                        <td>
                            @if(qcmNiveauQuestion.getNiveauQuestion == null) {
                                <em>-</em>
                            } else {
                                @qcmNiveauQuestion.getNiveauQuestion.getLibelleNiveau() 
                            }
                        </td> 
                        <td>
                        	<a href="@routes.AdminQcmNiveauQuestion.editQcmNiveauQuestion(qcmNiveauQuestion.getIdQcmNiveauQuestion)">@qcmNiveauQuestion.getPointPositif </a>
                        </td>
                        <td>
                        	<a href="@routes.AdminQcmNiveauQuestion.editQcmNiveauQuestion(qcmNiveauQuestion.getIdQcmNiveauQuestion)">@qcmNiveauQuestion.getPointNegatif </a>
                        </td>                       
                    </tr>
                }
				
            </tbody>
            
        </table>

        <div id="actions">   
                <a class="btn success" id="add" href="@routes.Application.consoleAdmin()">Retour</a>    
        <a class="btn success" id="add" href="@routes.AdminQcmNiveauQuestion.createQcmNiveauQuestion()">Ajouter un qcmQcmNiveauQuestion</a>    
   		 </div>

    
        </div>
       


    
        <div id="pagination" class="pagination">
            <ul>
                @if(currentPage.hasPrev) {
                    <li class="prev">
                        <a href="@link(currentPage.getPageIndex - 1, null)">&larr; Previous</a>
                    </li>
                } else {
                    <li class="prev disabled">
                        <a>&larr; Previous</a>
                    </li>
                }
                <li class="current">
                    <a>Displaying @currentPage.getDisplayXtoYofZ(" to "," of ")</a>
                </li>
                @if(currentPage.hasNext) {
                    <li class="next">
                        <a href="@link(currentPage.getPageIndex + 1, null)">Next &rarr;</a>
                    </li>
                } else {
                    <li class="next disabled">
                        <a>Next &rarr;</a>
                    </li>
                }
            </ul>
        </div>
        
    }
        
}

            